import request from '@/utils/request'

// 查询商品规格其他信息列表
export function listShopNormsOther(query) {
  return request({
    url: '/shop/shopNormsOther/list',
    method: 'get',
    params: query
  })
}

// 查询商品规格其他信息详细
export function getShopNormsOther(id) {
  return request({
    url: '/shop/shopNormsOther/' + id,
    method: 'get'
  })
}

// 新增商品规格其他信息
export function addShopNormsOther(data) {
  return request({
    url: '/shop/shopNormsOther',
    method: 'post',
    data: data
  })
}

// 修改商品规格其他信息
export function updateShopNormsOther(data) {
  return request({
    url: '/shop/shopNormsOther',
    method: 'put',
    data: data
  })
}

// 删除商品规格其他信息
export function delShopNormsOther(id) {
  return request({
    url: '/shop/shopNormsOther/' + id,
    method: 'delete'
  })
}

//根据id删除商品规格其他信息
export function removeByOtherId(otherId) {
  return request({
    url: '/shop/shopNormsOther/removeByOtherId/' + otherId,
    method: 'delete'
  })
}

// 查询商品规格列表
export function getAllNormAndOtherList() {
  return request({
    url: '/shop/shopNormsOther/getAllNormAndOtherList',
    method: 'get'
  })
}

//确认使用
export function confirmUseInfo(data) {
  return request({
    url: '/shop/shopNormsOther/confirmUseInfo',
    method: 'post',
    data:data
  })
}

//根据商品id查询商品规格名
export function getNormsByActiveId(spActiveId){
  return request({
    url: '/shop/shopNormsOther/getNormsByActiveId/'+spActiveId,
    method: 'get'
  })
}

//更新商品规格其他信息
export function updateNormsOtherInfo(data){
  return request({
    url: '/shop/normsAfter/updateNormsOtherInfo',
    method:'put',
    data:data
  })
}

//根据spOthersId修改被选择的状态
export function updateChooseById(spOthersId){
  return request({
    url: '/shop/shopNormsOther/updateChoose/'+spOthersId,
    method: 'put'
  })
}


